package com.dc.business.datacollectbusiness.controller;

import com.dc.business.datacollectbusiness.model.Result;
import com.dc.business.datacollectbusiness.service.HoursDayMounthDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@RequestMapping("/api/hourdaymounth")//(没用到)
public class HoursDayMounthDataController {
    @Autowired
    private HoursDayMounthDataService hoursDayMounthDataService;
    @GetMapping("/hour/{tfcollecterproductcode}/{channelno}/{startTime}/{endTime}")
    public Result hour(@PathVariable String tfcollecterproductcode, @PathVariable int channelno, @PathVariable String startTime, @PathVariable String endTime) {
        return Result.success(hoursDayMounthDataService.getByHours(tfcollecterproductcode, channelno,startTime,endTime));
    }
    @GetMapping("/day/{tfcollecterproductcode}/{channelno}/{startTime}/{endTime}")
    public Result day(@PathVariable String tfcollecterproductcode, @PathVariable int channelno, @PathVariable String startTime, @PathVariable String endTime) {
        return Result.success(hoursDayMounthDataService.getByDays(tfcollecterproductcode, channelno,startTime,endTime));
    }
    @GetMapping("/mounths/{tfcollecterproductcode}/{channelno}/{startTime}/{endTime}")
    public Result mounth(@PathVariable String tfcollecterproductcode, @PathVariable int channelno, @PathVariable String startTime, @PathVariable String endTime) {
        return Result.success(hoursDayMounthDataService.getByMounth(tfcollecterproductcode, channelno,startTime,endTime));
    }
}
